package com.rxkj.mapper;

import com.rxkj.entity.sys.SysOprateLog;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SysOPLogMapper {

    @Insert("insert into sys_oplog(uid,uname,gid,logtype,opcontent,opip,oplocation,optime,reqjson,requrl,mark)" +
            "values(#{uid},#{uname},#{gid},#{logtype},#{opcontent},#{opip},#{oplocation},#{optime},#{reqjson},#{requrl},#{mark})")
    @ResultType(Integer.class)
    Integer savesyslog(SysOprateLog sopl);

    @Select("select count(1) from sys_oplog")
    @ResultType(Integer.class)
    Integer getTotalRows();

    @Select("select * from sys_oplog order by optime desc limit #{start}, #{end}")
    @ResultType(SysOprateLog.class)
    List<SysOprateLog> querySysLog(@Param("start") int start, @Param("end") int end);
}
